import { AxiosRequestConfig, AxiosResponse } from "axios";

/**
 * @Description ZYRequestInterceptors 继承于axios中的AxiosResponse接口;
 */

export interface ZYRequestInterceptors<T = AxiosResponse> {
  requestInterceptor?: (config: AxiosRequestConfig) => AxiosRequestConfig;
  requestInterceptorCatch?: (config: any) => any;
  responseInterceptor?: (config: T) => T;
  responseInterceptorCatch?: (config: any) => any;
}

/**
 * @Description ZYRequestConfig 拦截器的类型注解
 */
//扩展自己的类型
export interface ZYRequestConfig<T = AxiosResponse> extends AxiosRequestConfig {
  interceptors?: ZYRequestInterceptors<T>;
  showLoading?: boolean;
}
